/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xos_cat.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __CONFIG_CONFIG_H__
#define __CONFIG_CONFIG_H__

namespace xos_cat
{

    class config
    {
    public:
        typedef std::list< std::string > STR_LIST;
        typedef STR_LIST::iterator STR_ITER;

    public:
        config();
        ~config();

    protected:
        int load( const char * lpszFile );
        int get_config();

    protected:
        // config obj
        xos_box::i_str_property* m_pConfigProp;
        xos_box::i_variant* m_pConfig;

    public:
        // heart
        int heart_check_interval_ms;
        int sys_heart_interval_ms;

        // thread
        int max_worker_thread_num;
        int max_slow_thread_num;

        // modules
        STR_LIST m_module_list;

        // auto quit
        bool m_b_auto_quit;

    public:
        static config* get();
        static int init();
        static int term();

    };

} // xos_cat

#endif // __CONFIG_CONFIG_H__
